/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package dao;

import entity.Evenement;
import entity.TypeBillet;
import entity.Typeb;
import java.util.List;

/**
 *
 * @author linos
 */
public class NewMain1 {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Evenement lists = new EvenementDAO().findById(19);
        Typeb typebGradin = new Typeb();
        TypeBilletDAO BilletDAO = new TypeBilletDAO();
        TypeBillet typeBillet = BilletDAO.findById(13);
        TypebDAO typebDAO = new TypebDAO();
        typebDAO.beginTransaction();
      // for (int i = 0; i < lists.size(); i++) {
            typebGradin.setTypeBillet(typeBillet);
            typebGradin.setPrix(0);
            typebGradin.setEvenement(lists);
            typebDAO.save(typebGradin);
            typebGradin = new Typeb();
        //}
        typebDAO.commit();
    }
}
